<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE>Getting started</TITLE>
	<META NAME="GENERATOR" CONTENT="LibreOffice 3.5  (Linux)">
	<META NAME="AUTHOR" CONTENT="Vaclav Naydionov">
	<META NAME="CREATED" CONTENT="20130618;22411100">
	<META NAME="CHANGEDBY" CONTENT="Viacheslav Naydenov">
	<META NAME="CHANGED" CONTENT="20140717;593500">
	<META NAME="CHANGEDBY" CONTENT="Viacheslav Naydenov">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 2cm }
		P { margin-top: 0.1cm; margin-bottom: 0.1cm }
		H1.cjk { font-family: "Droid Sans Fallback" }
		H1.ctl { font-family: "Lohit Hindi" }
		H2 { margin-bottom: 0.21cm }
		H2.western { font-family: "Times New Roman", serif }
		H2.cjk { font-family: "Droid Sans Fallback" }
		H2.ctl { font-family: "Lohit Hindi" }
		PRE.western { font-family: "Courier New", monospace }
		PRE.cjk { font-family: "Droid Sans Fallback", monospace }
		PRE.ctl { font-family: "Lohit Hindi", monospace }
		TD P { margin-top: 0.1cm; margin-bottom: 0.1cm }
		TH P { margin-top: 0.1cm; margin-bottom: 0.1cm }
		TT.western { font-family: "Courier New", monospace }
		TT.cjk { font-family: "Droid Sans Fallback", monospace }
		TT.ctl { font-family: "Lohit Hindi", monospace }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1 CLASS="western">Getting started</H1>
<P>To try YB.ORM tool in your environment, first you'll need to build
the library and the command line utility for code generation. There
are several ways to achieve this. 
</P>
<UL>
	<LI><P>For Windows users, the easier way is to get a pre-built
	package compatible with your compiler. See <STRONG>Pre-built
	packages</STRONG>. 
	</P>
	<LI><P>In any environment you can download one of released source
	package tarballs, configure and build. There are two build system
	available: <A HREF="http://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html">Autotools</A>
	and <A HREF="http://www.cmake.org/">CMake</A>, see <STRONG>Building
	with Autotools</STRONG> and <STRONG>Building with CMake</STRONG>. 
	</P>
	<LI><P>For Debian/Ubuntu based GNU Linux systems there are files to
	help building a <TT CLASS="western">.deb</TT> package.</P>
</UL>
<P>Use <A HREF="http://git-scm.com/">Git</A> to pull fresh code from
repository, see <A HREF="https://github.com/vnaydionov/yb-orm">YB.ORM
Git repository</A>, and then use either Autotools or CMake. 
</P>
<P>Then you'll probably want to setup a test database to run provided
tests and samples, see <STRONG>Setting up test database</STRONG>. 
</P>
<H1 CLASS="western"><A NAME="Pre-built_packages"></A>Pre-built
packages</H1>
<P>There are pre-built packages released for Microsoft Windows
developers in form of .zip-files, to make it easier to play with the
library and tools. Each package is built against a specific version
of <A HREF="http://www.boost.org/">Boost</A> or <A HREF="http://qt-project.org/">Qt</A>
toolkit, compiled with a specific version of C++ compiler (e.g. MinGW
4.4, MSVC 2013, MSVC 2010, etc.). A Boost-enabled package includes
all the required components of Boost libraries, whereas Qt-enabled
one requires you to install proper version of Qt SDK beforehand. By
default, Boost-enabled version has ODBC as database backend API plus
SQLite native driver, and Qt-enabled version relies on <A HREF="http://qt-project.org/doc/qt-4.8/qtsql.html">QtSql</A>.
Of course, you can still configure YB.ORM to use your
toolkit/compiler/database backend of choice, source code is included.
</P>
<P><STRONG>Note for Qt4 and MinGW</STRONG>: the Qt4 SDK was built
using MinGW 4.4.0, that is not available from the official site
anymore, but you can grab it from <A HREF="http://nosymbolfound.blogspot.ru/2012/12/since-until-now-qt-under-windows-is.html">here</A>.
</P>
<H2 CLASS="western"><A NAME="Pre-built_package_contents"></A>Pre-built
package contents</H2>
<P>A .zip-file containing YB.ORM library pre-built for Microsoft
Windows is extracted at location <TT CLASS="western">c:\yborm-&lt;version&gt;-&lt;compiler
name&gt;</TT> by default. The description below assumes path <TT CLASS="western">c:\yborm</TT>
as a root folder. Upon extraction there is the following folder
layout: 
</P>
<TABLE CELLPADDING=2 CELLSPACING=2>
	<TR>
		<TH STYLE="border: none; padding: 0cm">
            <P><STRONG>Path</STRONG></P>
		</TH>
		<TH STYLE="border: none; padding: 0cm">
            <P><STRONG>Description</STRONG></P>
		</TH>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>the root of YB.ORM installation</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\bin</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<UL>
				<LI><P><TT CLASS="western">.dll</TT>-files of the library, e. g.
                <STRONG><TT CLASS="western">ybutil.dll</TT></STRONG>,
                <STRONG><TT CLASS="western">yborm.dll</TT></STRONG>.</P>
				<LI><P><TT CLASS="western">.dll</TT>-files that this build may
				depend on: <TT CLASS="western">boost_date_time</TT>,
				<TT CLASS="western">boost_thread</TT>, <TT CLASS="western">cppunit</TT>,
				<TT CLASS="western">libxml2</TT>, <TT CLASS="western">sqlite3</TT>,
				misc. runtime 
				</P>
				<LI><P>some utilities: <TT CLASS="western">iconv.exe</TT>,
				<TT CLASS="western">xmllint.exe</TT>, <TT CLASS="western">xsltproc.exe</TT>,
				<TT CLASS="western">sqlite3.exe</TT> 
				</P>
				<LI><P>code-generation utility: <STRONG><TT CLASS="western">yborm_gen.exe</TT></STRONG>
								</P>
				<LI><P>environment configuration: <STRONG><TT CLASS="western">yborm_env.bat</TT></STRONG></P>
			</UL>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\build</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>build folder for the library itself</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\build-auth</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>build folder for the Auth demo</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\build-tut</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>build folder for examples from the Tutorial</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\doc</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>bits of documentation</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\examples</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>compiled examples and tests, schema files, test <A HREF="http://www.sqlite.org/">SQLite3</A>
			database, convenience <TT CLASS="western">.bat</TT>-files</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\include</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>header files for <A HREF="http://www.sqlite.org/">SQLite3</A>
			and also:</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\include\boost</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>- for <A HREF="http://www.boost.org/">Boost</A> version bundled</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\include\cppunit</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>- for <A HREF="http://sourceforge.net/apps/mediawiki/cppunit/">CppUnit</A>
			version bundled</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\include\libxml</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>- for <A HREF="http://www.xmlsoft.org/">LibXml2</A> version
			bundled</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\include\yb</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>- <STRONG>YB.ORM header files</STRONG></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\lib</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>YB.ORM static libraries, in case of static build, or import
			libraries, if dynamic: <STRONG><TT CLASS="western">ybutil.lib</TT></STRONG>,
			<STRONG><TT CLASS="western">yborm.lib</TT></STRONG> (or <TT CLASS="western">.a</TT>-files
			for MinGW); also here: import libraries for YB.ORM dependencies</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">c:\yborm\src</TT></P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>source code for this version 
			</P>
		</TD>
	</TR>
</TABLE>
<P>After unpacking you can run tests and examples from <TT CLASS="western">examples</TT>
folder with no additional configuration. 
</P>
<H2 CLASS="western"><A NAME="Rebuilding_YB.ORM_package"></A>Rebuilding
YB.ORM package</H2>
<P>The most simple way to build YB.ORM under MS Windows is to rebuild
one of pre-built packages. This may be useful if you already have
YB.ORM installed and you just wanted to update your installation with
fresh sources from Git, or you have downloaded a Qt-enabled build and
wanted to rebuild it with Boost. It this case put updated sources
under <TT CLASS="western">src</TT> folder, then use command line
window to <TT CLASS="western">cd</TT> into <TT CLASS="western">build</TT>
folder and start corresponding <TT CLASS="western">build-*.bat</TT>-file
from there. If you're using MS Visual C++ you'll need to launch that
<TT CLASS="western">.bat</TT>-file from within <EM>Visual Studio
command line prompt</EM>. All those <TT CLASS="western">.bat</TT>-files
do is just calling CMake script with predefined configuration
parameters and then run <TT CLASS="western">make</TT> command. After
build is successfully completed the new libraries, headers, examples
and code generation utility replace old ones in corresponding
folders. Below are the prerequisites for the rebuild process. 
</P>
<TABLE CELLPADDING=2 CELLSPACING=2>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>Build system: 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>CMake 2.8 installed, accessible via environment variable <TT CLASS="western">PATH</TT>
						</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>Compiler: 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>MinGW GCC 4.4.0, MS Visual C++ 2013, 2010, 2008, or whatever
			the package was built with</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>Qt SDK: 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>tested with Qt4.8 and Qt5.0.2, required only for Qt-enabled build, see the
			note above, where to get the &quot;right&quot; version of MinGW. 
			</P>
		</TD>
	</TR>
</TABLE>
<P>Make sure you specified proper toolkit mode (with or without Qt)
and also set <TT CLASS="western">PATH</TT> to your compiler and Qt
SDK in file <STRONG><TT CLASS="western">\bin\yborm_env.bat</TT></STRONG>.
</P>
<P>In same way you can build Auth example and Tutorial (without Qt
only) examples in folders <TT CLASS="western">build-auth</TT> and
<TT CLASS="western">build-tut</TT>, correspondingly. 
</P>
<H1 CLASS="western"><A NAME="Building_with_Autotools"></A>Building
with Autotools</H1>
<P>This piece of software is developed primarily under Ubuntu Linux,
using GNU tool chain, including GNU Autotools. You can build YB.ORM
in a POSIX-compatible environment, such as Linux, FreeBSD, Mac OS X
or Cygwin. Typical steps are: 
</P>
<PRE CLASS="western">$ sh autogen.sh  # create configure script; only needed after &quot;git clone&quot;, not for sources from tarball
$ ./configure --prefix=/home/user1/yb-orm --with-test-db-url=sqlite+sqlite:///home/user1/test1_db.sqlite --disable-static
$ make
$ make check     # to run tests you need to create /home/user1/test1_db.sqlite first
$ make install   # will be installed under /home/user1/yb-orm</PRE><P>
The <TT CLASS="western">configure</TT> script tries to guess
automatically which libraries are available and where their header
files can be found. There are number of options you can pass to the
<TT CLASS="western">configure</TT> script, to affect the process.
Also you can specify parameters for the test database connection. To
trigger a build with Qt use <TT CLASS="western">--with-qt-includes</TT>,
<TT CLASS="western">--with-qt-libs</TT>, for a wxWidgets-enabled
build use <TT CLASS="western">--with-wx-config</TT>. 
</P>
<PRE CLASS="western">$ ./configure –help
...
  --prefix=PREFIX         install architecture-independent files in
                          PREFIX [/usr/local]
  --with-qt-includes=DIR  Directory where the Qt4/Qt5 C++ includes reside
  --with-qt-libs=DIR      Directory where the Qt4/Qt5 C++ libraries reside
  --with-wx-config=BIN    Configuration script for the wxWidgets
                          C++ library
  --with-boost=DIR        prefix of Boost 1.31.0 [guess]
  --with-soci-includes=DIR
                          Place where SOCI includes are
  --with-soci-libs=DIR    Place where SOCI library is
  --with-test-db-url=dialect+driver://user:password@database or like
                          Specify the URL to connect to the test database
...</PRE><P>
The custom macros that <TT CLASS="western">configure</TT> uses are
placed in <TT CLASS="western">acinclude.m4</TT> file. When you build
your own application with Autotools and YB.ORM you can take
<TT CLASS="western">YB_CHECK_YBORM()</TT> macro to your <TT CLASS="western">configure.ac</TT>
file. This will add option <TT CLASS="western">--with-yborm-root</TT>
to your <TT CLASS="western">configure</TT> script. See the <A
HREF="https://github.com/vnaydionov/yb-orm/blob/master/examples/auth/README.auth">Auth
example</A>. 
</P>
<H2 CLASS="western"><A NAME="Minimal_requirements"></A>Minimal
requirements</H2>
<P>YB.ORM is known to build without problems on Ubuntu Linux,
starting from Ubuntu 8.04. The following versions of packages should
be fine: 
</P>
<UL>
	<LI><P>libboost-thread-dev &gt;= 1.34.1 
	</P>
	<LI><P>libboost-date-time-dev &gt;= 1.34.1 
	</P>
	<LI><P>libxml2-dev &gt;= 2.6.31 
	</P>
	<LI><P>libcppunit-dev &gt;= 1.12.0 (if you're going to run the test
	suite) 
	</P>
	<LI><P>autoconf &gt;= 2.61 
	</P>
	<LI><P>automake &gt;= 1.10.1 
	</P>
	<LI><P>libqt4-dev &gt;= 4.5 (tested on Ubuntu 9.04) 
	</P>
	<LI><P>libwxgtk2.8-dev &gt;= 2.8.12 
	</P>
</UL>
<P>To access some database you will need one of the following: 
</P>
<UL>
	<LI><P>libsqlite3-dev &gt;= 3.7.9 
	</P>
	<LI><P>soci &gt;= 3.2.0 
	</P>
	<LI><P>unixodbc-dev &gt;= 2.2.14 (to make Oracle ODBC driver work
	under Ubuntu 8.04 64bit I had to use unixODBC = 2.3.0) 
	</P>
	<LI><P>instantclient &gt;= 10.2 (client and ODBC driver for Oracle) 
	</P>
	<LI><P>libmyodbc &gt;= 5.1.10 
	</P>
	<LI><P>odbc-postgresql &gt;= 09.00.0310 
	</P>
</UL>
<H1 CLASS="western"><A NAME="Building_with_CMake"></A>Building with
CMake</H1>
<P>GNU Autotools are useless when it comes to Microsoft Visual C++ or
any other Windows compiler beside of MinGW GCC. So there are CMake
scripts for building YB.ORM on Windows, although they will do the job
in POSIX environment too. This method was tested for the following
versions: 
</P>
<UL>
	<LI><P>MS Visual C++ 2013 Express Edition, Boost 1.53.0</P>
	<LI><P>MS Visual C++ 2010 Express Edition, Boost 1.46.1, Qt 4.8.1 
	</P>
	<LI><P>MS Visual C++ 2008 Express Edition, Boost 1.38.0, Qt 4.8.1 
	</P>
	<LI><P>MinGW GCC 4.4.0, Boost 1.46.1, Qt 4.8.1</P>
	<LI><P>Ubuntu Linux GCC 4.6.3, Boost 1.46.1, Qt 4.8.1 
	</P>
</UL>
<P>Download CMake 2.8 from here:
<A HREF="http://www.cmake.org/cmake/resources/software.html">http://www.cmake.org/cmake/resources/software.html</A>
Make sure you have <TT CLASS="western">cmake</TT> command accessible
on your <TT CLASS="western">PATH</TT> environment variable. 
</P>
<P>You can pass parameters to CMake, here are some examples: 
</P>
<TABLE CELLPADDING=2 CELLSPACING=2>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>-G &quot;NMake Makefiles&quot; 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>what kind of Makefiles to generate 
			</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>-D USE_QT:BOOL=ON 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>build with Qt 
			</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>-D CMAKE_INSTALL_PREFIX=c:/yborm 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>set installation prefix 
			</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>-D SOCI_INCLUDEDIR:PATH=c:/work/soci-3.2.1/include/soci 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>SOCI include directory 
			</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P>-D SOCI_LIBS:FILEPATH=c:/work/soci-3.2.1/lib/libsoci_core.lib 
			</P>
		</TD>
		<TD STYLE="border: none; padding: 0cm">
			<P>SOCI library file 
			</P>
		</TD>
	</TR>
</TABLE>
<H1 CLASS="western"><A NAME="Setting_up_test_database"></A>Setting up
test database</H1>
<P>To run tests and examples you'll need a test database. If you have
downloaded a pre-built package for Windows, then there is already an
SQLite3 test database residing at <TT CLASS="western">c:\yborm\examples\test1_db</TT>,
assuming you unpacked the package to <TT CLASS="western">c:\yborm</TT>.
In other cases you'll have to create the test database (or schema),
then create test tables within it. 
</P>
<P>In case you are using ODBC, you'll also have to set up ODBC
datasource (DSN) for your database via <TT CLASS="western">odbcad32.exe</TT>.
In POSIX environment edit configuraion files: <TT CLASS="western">/etc/odbcinst.ini</TT>
- for driver setup and <TT CLASS="western">~/.odbc.ini</TT> - for
user's DSN entries. 
</P>
<P>Note for Windows 64-bit users: since this library comes with
pre-built packages compiled in 32-bit mode, unless you've managed to
rebuild it with a 64-bit compiler, use 32-bit version of
<TT CLASS="western">odbcad32.exe</TT>:
<TT CLASS="western">c:\windows\syswow64\odbcad32.exe</TT>. 
</P>
<P>Follow the steps below to create an empty test database with a
test user account (using SQLite3, MySQL, Postgres or Firebird), and
then create test tables in the database. 
</P>
<H2 CLASS="western"><A NAME="SQLite3"></A>SQLite3</H2>
<P>Sample connection strings for SQLite3: 
</P>
<TABLE CELLPADDING=2 CELLSPACING=2>
	<COL WIDTH=0>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;sqlite+sqlite://./test1_db&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;sqlite+sqlite://c:/yborm/examples/test1_db&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;sqlite+qtsql://c:/yborm/examples/test1_db&quot;</TT></P>
		</TD>
	</TR>
</TABLE>
<P>This driver is the default for pre-build packages. The <TT CLASS="western">sqlite3.exe</TT>
shell is bundled with pre-built YB.ORM packages, see folder <TT CLASS="western">bin</TT>.
</P>
<P>Apply generated SQL scripts like this: 
</P>
<PRE CLASS="western">C:\yborm\bin&gt;sqlite3 c:\yborm\examples\test1_db &lt; c:\yborm\examples\test_schema.sql
C:\yborm\bin&gt;sqlite3 c:\yborm\examples\test1_db &lt; c:\yborm\examples\ex2_schema.sql
C:\yborm\bin&gt;sqlite3 c:\yborm\examples\test1_db &lt; c:\yborm\examples\auth_schema.sql</PRE><H2 CLASS="western">
<A NAME="MySQL"></A>MySQL</H2>
<P>Sample connection strings for MySQL: 
</P>
<TABLE CELLPADDING=2 CELLSPACING=2>
	<COL WIDTH=0>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;mysql+odbc://test1_usr:test1_pwd@test1_dsn&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;mysql+soci://user=test1
			pass=test1_pwd host=localhost service=test1_db&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;mysql+soci_odbc://DSN=test1_dsn;UID=test1_usr;PWS=test1_pwd&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;mysql+qodbc3://test1_usr:test1_pwd@test1_dsn&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;mysql+qtsql://test1_usr:test1_pwd@127.0.0.1:3306/test1_db&quot;</TT></P>
		</TD>
	</TR>
</TABLE>
<P>You must know the <TT CLASS="western">root</TT> password for your
MySQL database to be able to manage databases and users. 
</P>
<PRE CLASS="western">C:\MySQL\bin&gt;mysql.exe -u root -p mysql
Enter password: ******** &lt;-- type in here your root password for MySQL
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 361
Server version: 5.0.51b-community-nt-log MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql&gt; create database test1_db default charset utf8;
Query OK, 1 row affected (0.00 sec)
mysql&gt; create user 'test1_usr'@'localhost' identified by 'test1_pwd';
Query OK, 0 rows affected (0.00 sec)
mysql&gt; grant all on test1_db.* to 'test1_usr'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql&gt; exit
Bye</PRE><P>
Apply generated SQL scripts like this: 
</P>
<PRE CLASS="western">C:\MySQL\bin&gt;mysql.exe -u test1_usr -ptest1_pwd test1_db &lt; c:\yborm\examples\test_schema.sql
C:\MySQL\bin&gt;mysql.exe -u test1_usr -ptest1_pwd test1_db &lt; c:\yborm\examples\ex2_schema.sql
C:\MySQL\bin&gt;mysql.exe -u test1_usr -ptest1_pwd test1_db &lt; c:\yborm\examples\auth_schema.sql</PRE><H2 CLASS="western">
<A NAME="Postgres"></A>Postgres</H2>
<P>Sample connection strings for Postgres: 
</P>
<TABLE CELLPADDING=2 CELLSPACING=2>
	<COL WIDTH=0>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;postgres+odbc://test1_usr:test1_pwd@test1_dsn&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;postgres+qodbc3://test1_usr:test1_pwd@test1_dsn&quot;</TT></P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;postgres+qtsql://test1_usr:test1_pwd@127.0.0.1:5432/test1_db&quot;</TT></P>
		</TD>
	</TR>
</TABLE>
<PRE CLASS="western">C:\Program Files\PostgreSQL\9.1\bin&gt;createuser -U postgres -h 127.0.0.1 -p 5432 -D -A -P test1_usr
Enter password for new role: test1_pwd
Enter it again: test1_pwd
Shall the new role be allowed to create more new roles? (y/n) n
Password: &lt;your master password&gt;
C:\Program Files\PostgreSQL\9.1\bin&gt;createdb -U postgres -h 127.0.0.1 -p 5432 -O test1_usr test1_db
Password: &lt;your master password&gt;</PRE><P>
Apply generated SQL scripts like this: 
</P>
<PRE CLASS="western">C:\Program Files\PostgreSQL\9.1\bin&gt;psql -h 127.0.0.1 -p 5432 -d test1_db -U test1_usr &lt; c:\yborm\examples\test_schema.sql
Password for user test1_usr: test1_pwd
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index &quot;t_orm_test_pkey&quot; for table &quot;t_orm_test&quot;
CREATE TABLE
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index &quot;t_orm_xml_pkey&quot; for table &quot;t_orm_xml&quot;
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE
CREATE SEQUENCE
C:\Program Files\PostgreSQL\9.1\bin&gt;psql -h 127.0.0.1 -p 5432 -d test1_db -U test1_usr &lt; c:\yborm\examples\ex2_schema.sql
Password for user test1_usr: test1_pwd
...
C:\Program Files\PostgreSQL\9.1\bin&gt;psql -h 127.0.0.1 -p 5432 -d test1_db -U test1_usr &lt; c:\yborm\examples\auth_schema.sql
Password for user test1_usr: test1_pwd
...</PRE><H2 CLASS="western">
<A NAME="Firebird"></A>Firebird</H2>
<P>Sample connection strings for Firebird (Interbase may also apply):
</P>
<TABLE CELLPADDING=2 CELLSPACING=2>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;interbase+odbc://test1_usr:test1_pwd@test1_dsn&quot;</TT>
						</P>
		</TD>
	</TR>
	<TR>
		<TD STYLE="border: none; padding: 0cm">
			<P><TT CLASS="western">&quot;interbase+soci://service=localhost:/var/lib/firebird/2.5/data/test1_db.fdb
			user=test1_usr password=test1_pwd charset=UTF8&quot;</TT> 
			</P>
		</TD>
	</TR>
</TABLE>
<P>The default password for admin user <TT CLASS="western">SYSDBA</TT>
is <TT CLASS="western">masterkey</TT>. 
</P>
<PRE CLASS="western">C:\Program Files\Firebird\Firebird_2_5\bin&gt;gsec -user SYSDBA -password masterkey
GSEC&gt; add test1_usr -pw test1_pwd
Warning - maximum 8 significant bytes of password used
GSEC&gt; quit
C:\Program Files\Firebird\Firebird_2_5\bin&gt;isql
Use CONNECT or CREATE DATABASE to specify a database
SQL&gt; CREATE DATABASE 'localhost:c:/yborm/examples/test1_db.fdb'
CON&gt; page_size 8192 user 'test1_usr' password 'test1_pwd';
SQL&gt; quit;</PRE><P>
Apply generated SQL scripts like this: 
</P>
<PRE CLASS="western">C:\Program Files\Firebird\Firebird_2_5\bin&gt;isql -u test1_usr -p test1_pwd localhost:c:/yborm/examples/test1_db.fdb &lt; c:\yborm\examples\test_schema.sql
C:\Program Files\Firebird\Firebird_2_5\bin&gt;isql -u test1_usr -p test1_pwd localhost:c:/yborm/examples/test1_db.fdb &lt; c:\yborm\examples\ex2_schema.sql
C:\Program Files\Firebird\Firebird_2_5\bin&gt;isql -u test1_usr -p test1_pwd localhost:c:/yborm/examples/test1_db.fdb &lt; c:\yborm\examples\auth_schema.sql</PRE><P>
In Ubuntu Linux, the usage of <TT CLASS="western">gsec</TT> is the
same, but you may have to use <TT CLASS="western">isql-fb</TT>
command instead of <TT CLASS="western">isql</TT>: 
</P>
<PRE CLASS="western">$ isql-fb
Use CONNECT or CREATE DATABASE to specify a database
SQL&gt; CREATE DATABASE '/var/lib/firebird/2.5/data/test1_db.fdb'
CON&gt; page_size 8192 user 'test1_usr' password 'test1_pwd';
SQL&gt; quit;
$ isql-fb -u test1_usr -p test1_pwd \
 localhost:/var/lib/firebird/2.5/data/test1_db.fdb &lt; lib/orm/test/mk_tables.sql
$ isql-fb -u test1_usr -p test1_pwd \
 localhost:/var/lib/firebird/2.5/data/test1_db.fdb &lt; examples/domain/mk_tables.sql
$ isql-fb -u test1_usr -p test1_pwd \
 localhost:/var/lib/firebird/2.5/data/test1_db.fdb &lt; examples/auth/src/domain/auth_schema.sql</PRE>
</BODY>
</HTML>
